package com.qf.dao;

import com.qf.entity.Users;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;

import java.util.Date;
import java.util.List;

public interface UsersDao extends JpaRepository<Users,Integer> {
  //根据用户名和密码进行查询
    //select * from users where username=? and password=?
    public Users findByUsernameAndPassword(String name,String pass);
    //区间
    public List<Users> findByBirthdayBetween(Date begin, Date end);
    //模糊查
    public List<Users> findByUsernameLike(String name);
    public List<Users> findByUsernameStartingWith(String name);
    public List<Users> findByUsernameContaining(String name);
    //in
    public List<Users> findByUserIdIn(List list, Sort sort);
    //count
    public int countByUsernameContaining(String name);
    //分页
    public Page findByUsernameLike(String name, Pageable pageable);
}
